<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Date</title>
        <script type="text/javascript">
          function formatiraniDatum() {
              var datum = new Date();
              var rezultat;
              rezultat = datum.getFullYear() + "-" + datum.getMonth() + "-" + datum.getDay();
              return rezultat;
          }
        </script>
    </head>
    <body>
        <script type="text/javascript">
          var datum = new Date();
          document.write(datum);
        </script>
        <br/>
        <script>
          document.write(formatiraniDatum());
        </script>
        <br/>
        <script>
         // alert(Date.parse("Jan 12, 1988"));
        </script>
    </body>
</html>